package com.googlecode.imanager.core.base;

import com.googlecode.imanager.client.bridge.BridgeType;
import com.googlecode.imanager.client.bridge.IControl;
import com.googlecode.imanager.client.bridge.style.IChildThemeHandler;

/**
 * @author wellsantos@wellsantos.com
 * @since 0.01
 */
public abstract class BridgeControl extends BridgeComponent implements IControl, IChildThemeHandler {

    protected final BridgeApplication application;
    
    public BridgeControl(BridgeApplication bridgeApplication) {
        this.application = bridgeApplication;
    }
    
    public BridgeApplication getBridgeApplication() {
        return application;
    }

    public final BridgeType getImplementationType(){
        return application.getImplementationType();
    }

    public final DefaultManager getManager() {
        return application.getManager();
    }
    
    public void processException(Exception e){
        getBridgeApplication().handleError(e);
    }
    
    protected final void startFireUIEvent(){
        getBridgeApplication().startFireUIEvent();
    }

    protected final void endFireUIEvent(){        
        getBridgeApplication().endFireUIEvent();
    }

}
